import axios from "axios";

const request = axios.create({
    timeout: 10000,
    baseURL: "/api/api"
})
const token = localStorage.getItem("token")
request.interceptors.request.use(config => {
    config.headers.tokenagent = token;
    return config;
}, (err) => {
    return Promise.reject(err);
})

request.interceptors.response.use(response => {
    return response.data;
}, (err) => {
    return Promise.reject(err);
})

export default request;